package com.study.design.pattern.pattern.behavioral.observer.spring;

import org.springframework.context.ApplicationEvent;

/**
 * @Author: gongsl
 * @Date: 2025-03-23 23:45
 * @description: 股价变化事件
 */
public class StockChangeEvent extends ApplicationEvent {
    private final double oldStockPrice;
    private final double newStockPrice;

    public StockChangeEvent(Object source, double oldStockPrice, double newStockPrice) {
        super(source);
        this.oldStockPrice = oldStockPrice;
        this.newStockPrice = newStockPrice;
    }

    public double getOldStockPrice() {
        return oldStockPrice;
    }

    public double getNewStockPrice() {
        return newStockPrice;
    }
}
